#include<bits/stdc++.h>

using namespace std;

const int MAXN = 3;

int n,oc=0,zc=0,tc=0,alive;

int main(){

	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);

	cin>>n;
	alive = n;
	for(int i = 1;i <= n;i ++ ){
		int tmp;
		cin>>tmp;
		if(tmp==0) zc++;
		if(tmp==1) oc++;
		if(tmp==2) tc++;
	}
	if(zc <= oc) alive -= zc;
	else alive -= oc;

	if(oc <= tc) alive -= oc;
	else alive -= tc;
	
	cout<<alive<<endl;

	return 0;
}